package ${feignPackage};

import com.douya.common.pojo.dto.PagerDTO;
import com.douya.common.pojo.vo.CommonResponseVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import ${dtoPackage}.${class}DTO;
import ${voPackage}.${class}VO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;

/**
 * 说明：${remarks}内部接口
 *
 * @author ${author}
 * @date ${date}
 */
@Validated
@RequestMapping("${feignUrl}")
@FeignClient(value = "${application}-application", url = "${r'$'}{douya.host.${application}}")
public interface ${class}Feign {

    /**
     * 分页获取${remarks}
     *
     * @param pagerDTO 分页条件
     * @return 分页信息
     */
    @GetMapping(value = "page")
    IPage${r'<'}${class}VO> page(@RequestParam("pagerDTO") PagerDTO pagerDTO);

    /**
    * 根据ID获取${remarks}
    *
    * @param id ID
    * @return ${remarks}
    */
    @GetMapping(value = "findById")
    ${class}VO findById(@NotNull(message = "ID不能为空") @RequestParam("id") Long id);

    /**
     * 新增/修改${remarks}
     *
     * @param ${name}DTO ${remarks}
     */
    @PostMapping(value = "insert")
    void insert(@Validated @RequestBody ${class}DTO ${name}DTO);

    /**
     * 根据ID删除${remarks}
     *
     * @param id ID
     */
    @DeleteMapping(value = "delete")
    void delete(@NotNull(message = "ID不能为空") @RequestParam("id") Long id);
}
